package com.qdu.util;

import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.Date;

public class DateUtil {
	
	public static String formatDate(Date date) {
		String f = new SimpleDateFormat("yyyy-MM-dd").format(date);
		return f;
	}
	public static String getToday() {
		LocalDateTime now = LocalDateTime.now(ZoneId.of("+8"));
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
		String format = formatter.format(now);
		return format;
	}
	
	 public static String formatTime(String date) {
	        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	        String now = sdf.format(date);
	        return now;
	   }

	
}
